package com.dawnClass.pojo;

import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

/*
* indexName索引名（数据库名称）
* type  文档类型（表名）
*/
@Document(indexName = "suhong",shards = 4,replicas = 0)
public class Item {
    @Id
    private int courseId;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String courseName;//名称
    @Field(type = FieldType.Keyword)
    private String courseSort;//分类
    @Field(type = FieldType.Double)
    private Double coursePrice;//价格
    @Field(type = FieldType.Integer)
    private Integer courseLearnNumber;//学习人数
    @Field(type = FieldType.Keyword)
    private String courseDifficulty;//难度
    @Field(index = false,type = FieldType.Keyword)
    private String courseImg;//图片地址

    public Item(){}

    public Item(int courseId, String courseName, String courseSort, Double coursePrice, Integer courseLearnNumber, String courseDifficulty, String courseImg) {
        this.courseId = courseId;
        this.courseName = courseName;
        this.courseSort = courseSort;
        this.coursePrice = coursePrice;
        this.courseLearnNumber = courseLearnNumber;
        this.courseDifficulty = courseDifficulty;
        this.courseImg = courseImg;
    }

    public int getCourseId() {
        return courseId;
    }

    public void setCourseId(int courseId) {
        this.courseId = courseId;
    }

    public String getCourseName() {
        return courseName;
    }

    public void setCourseName(String courseName) {
        this.courseName = courseName;
    }

    public String getCourseSort() {
        return courseSort;
    }

    public void setCourseSort(String courseSort) {
        this.courseSort = courseSort;
    }

    public Double getCoursePrice() {
        return coursePrice;
    }

    public void setCoursePrice(Double coursePrice) {
        this.coursePrice = coursePrice;
    }

    public Integer getCourseLearnNumber() {
        return courseLearnNumber;
    }

    public void setCourseLearnNumber(Integer courseLearnNumber) {
        this.courseLearnNumber = courseLearnNumber;
    }

    public String getCourseDifficulty() {
        return courseDifficulty;
    }

    public void setCourseDifficulty(String courseDifficulty) {
        this.courseDifficulty = courseDifficulty;
    }

    public String getCourseImg() {
        return courseImg;
    }

    public void setCourseImg(String courseImg) {
        this.courseImg = courseImg;
    }

    @Override
    public String toString() {
        return "Item{" +
                "courseId=" + courseId +
                ", courseName='" + courseName + '\'' +
                ", courseSort='" + courseSort + '\'' +
                ", coursePrice=" + coursePrice +
                ", courseLearnNumber=" + courseLearnNumber +
                ", courseDifficulty='" + courseDifficulty + '\'' +
                ", courseImg='" + courseImg + '\'' +
                '}';
    }
}
